{include file="common/head_exit"}
<style>
    table tr:nth-child(odd) {
        background: white;
    }
    
    table tr:nth-child(even) {
        background: #ccc;
    }
</style>
<table class="table table-condensed">

    <thead>
        <tr>
            <th>排名</th>
            <th>国家</th>
            <th>
                <img src="/meetTWO/public/static/index/picture/jin.png" class="gold_css"></th>
            <th>
                <img src="/meetTWO/public/static/index/picture/yin.png" class="gold_css"></th>
            <th>
                <img src="/meetTWO/public/static/index/picture/tong.png" class="gold_css"></th>
            <th>总数</th>
        </tr>
    </thead>
    <tbody id="gold">

    </tbody>
</table>
<div class="goto_fatie_box">
        <a href="javascript:void(0);" class="go-top">
            <img src="/meetTWO/public/static/index/picture/goto.png" />
        </a>
</div>
<script type="text/javascript">
    $.ajax({
        type: "GET",
        url: "/meetTWO/public/index/index/gold_data",
        data: 'data',
        type: 'get',
        cache: false,
        processData: false,
        contents: false,
        contentType: false,
        success: function(res) {
            res = JSON.parse(res);
            for (var i = 0; i < res.length; i++) {
                let gold_m = $('<tr><td>' + (i + 1) + '</td><td>' + res[i].name + '</td><td>' + res[i].gold + '</td><td>' + res[i].silver + '</td><td>' + res[i].copper + '</td><td>' + (res[i].gold + res[i].silver + res[i].copper) + '</td></tr>');
                $('#gold').append(gold_m);
            }

            // console.log(res[0].name);
        },
        error: function() {
            alert('网络错误')
        }
    })

    $(".go-top").click(function () {
		var dcm = '__';
		var top = dcm == 'forum_thread_show' ? $('header').height() : 0;
		$('body,html').animate({ scrollTop: top }, 300);
			return false;
		});
</script>